{layout name="common/layout" /}
<section class="panel">
    <header class="panel-heading">
        网站基本设置
    </header>
    <div class="panel-body">
        <ul class="nav nav-tabs nav-justified" role="tablist" id="setTab">
            <li role="presentation" class="active"><a href="#goodsbasic" role="tab" data-toggle="tab">商品基本信息</a></li>
            <li role="presentation"><a href="#goodsspec" role="tab" data-toggle="tab">库存/规格</a></li>
            <li role="presentation"><a href="#goodsdetail" role="tab" data-toggle="tab">商品详情</a></li>
        </ul>
        <br/>
        <form class="form-horizontal" method="post">
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="goodsbasic">
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">排序</label>
                        <div class="col-lg-10">
                            <input type="number" name="goods_sort" class="form-control" value="" >
                            <p class="help-block">数字越大，越靠前</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">商品名称</label>
                        <div class="col-lg-10">
                            <input type="text" name="goods_name" class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">副标题</label>
                        <div class="col-lg-10">
                            <input type="text" name="goods_key" class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">商品分类</label>
                        <div class="col-lg-10">

                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">商品价格</label>
                        <div class="col-lg-10">
                            <input type="text" name="seller_name" class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">商品图片</label>
                        {:tplImage('goods')}
                        <div class="col-lg-10 col-lg-offset-2"><div class="row"></div></div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">已售出</label>
                        <div class="col-lg-10">
                            <input type="number" name="seller_name" class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">所在地</label>
                        <div class="col-lg-10">
                            <div class="row">
                                <div class="col-xs-2">
                                    <select class="form-control" name="s_province" id="s_province" >
                                    </select>
                                </div>
                                <div class="col-xs-2">
                                    <select class="form-control" name="s_city" id="s_city" >
                                    </select>
                                </div>
                                <div class="col-xs-2">
                                    <select class="form-control" name="s_county" id="s_county" >
                                    </select>
                                </div>
                                <div class="col-xs-3">
                                    <span class="form-control " style="border: none; color: #428bca;" id="area_show"></span>
                                    <input type="hidden" name="seller_area" value="">
                                </div>
                            </div>
                            <p class="help-block">如：山东省，青岛市</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">运费</label>
                        <div class="col-lg-3">
                            <select class="form-control" name="shipping_id" onchange="shipping_select(this);">
                                <option value="0">选择运费</option>
                                <option value="1">固定运费</option>
                                <option value="2">包邮</option>
                            </select>
                        </div>
                        <div class="col-lg-3" id="shipp_select"></div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">付款方式</label>
                        <div class="col-lg-3">
                            <select class="form-control" name="pay_type" >
                                <option value="0">选择付款方式</option>
                                <option value="1">货到付款</option>
                                <option value="2">在线支付</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">上架</label>
                        <div class="col-lg-5">
                           <input type="radio" name="goods_state" value="1" checked>是 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="goods_state" value="0">否
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">是否支持退换货</label>
                        <div class="col-lg-5">
                            <input type="radio" name="is_refund" value="1" checked>是 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="is_refund" value="0">否
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="goodsspec">
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">编码</label>
                        <div class="col-lg-10">
                            <input type="text" name="seller_truename"  class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">条码</label>
                        <div class="col-lg-10">
                            <input type="text" name="seller_truename"  class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">库存</label>
                        <div class="col-lg-10">
                            <input type="number" name="seller_truename"  class="form-control" value="" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">规格</label>
                        <div class="col-lg-10">
                            <input type="text" name="seller_truename"  class="form-control" value="" >
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="goodsdetail">
                    <div class="form-group">
                        <label  class="col-lg-2 col-sm-2 control-label">选择参数类型</label>
                        <div class="col-lg-10">
                            <input type="text" name="seller_truename"  class="form-control" value="" >
                            <p class="help-block">如:王**</p>
                        </div>
                    </div>

                </div>
                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-10">
                        <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
            </div>
        </form>
    </div>

</section>
{js href="__PUBLIC__/js/area.js"}
<script type="application/javascript">
    $(document).ready(function () {
        //地区插件
        _init_area();
        $('#s_county').change(function () {
            var province = $('#s_province').val();
            var city = $('#s_city').val();
            var county = $('#s_county').val();
            $('#area_show').html(province+city+county);
            $('input[name="seller_area"]').val(province+city+county);
        });
    });
    function shipping_select(obj) {
        var shipping_id = $(obj).val();
        $('#shipp_select').empty();
        if(shipping_id==1){
            var shipping_div = '<input class="form-control" placeholder="请输入运费" type="number" name="shipping_fee">';
            $('#shipp_select').append(shipping_div);
        }
    }
</script>